﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;

namespace ibba.agil.core.Internal
{
    internal class ConnectionManager {
       
        private enum DBeh : byte
        {
            Principal = 0 << 1
        }

        private static SqlConnection _context;

        private static string GetDBehConfiguration(DBeh nomeDB)
        {
            return ConfigurationManager.AppSettings["EntityModel"].ToString();
        }


        public ConnectionManager(string conConfig) { }

        public static SqlConnection getContextDB()
        {
            if (_context == null)
            {
                _context = new SqlConnection(GetDBehConfiguration(DBeh.Principal));
            }
            return _context;  
        }


    }
}
